﻿using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;

namespace Urbania.GUI
{
    public class SelectableScreen
    {
        protected bool mouseIsIn;
        protected bool mouseClickingOn;
        protected Rectangle bounds;

        //public bool MouseClick { get { return this.mouseClickingOn; } }

        public void Update()
        {
            if (!Utilities.MouseWrap.isDown(0))
            {
                if (bounds.X <= Utilities.MouseWrap.PositionScreen.X && Utilities.MouseWrap.PositionScreen.X <= bounds.Right)
                    if (bounds.Y <= Utilities.MouseWrap.PositionScreen.Y && Utilities.MouseWrap.PositionScreen.Y <= bounds.Bottom)
                        mouseIsIn = true;
                    else
                        mouseIsIn = false;
                else
                    mouseIsIn = false;
            }

            if (mouseIsIn && Utilities.MouseWrap.wasReleased(0))
                mouseClickingOn = true;
            else
                mouseClickingOn = false;
        }
    }
}
